<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thông tin laptop</title>



<link href="../style/cssqt.css" rel="stylesheet" type="text/css" />
</head>

<body>
<?php
include("../config/config.php");
$lenh = "select tenlaptop, tenhanglaptop,tenloai,soluong, dongia,hinh,ngaynhap,malaptop from laptop,hanglaptop,loailaptop where laptop.mahanglaptop = hanglaptop.mahanglaptop and laptop.maloailaptop = loailaptop.maloailaptop";
$kq = mysql_query($lenh);
$sodong = 50;
$sodulieu = mysql_num_rows($kq);
$sotrang = ceil($sodulieu/$sodong);
if(!$_GET["p"])
$p =1;
else
$p = $_GET["p"];
$x = ($p-1)*$sodong;
$lenh1 = "select tenlaptop, tenhanglaptop,tenloai,soluong, dongia,hinh,ngaynhap,malaptop,noibat from laptop,hanglaptop,loailaptop where laptop.mahanglaptop = hanglaptop.mahanglaptop and laptop.maloailaptop = loailaptop.maloailaptop limit $x,$sodong";
$kq1 = mysql_query($lenh1);

?>
<table width="1110" border="1" align="center" cellpadding="0" cellspacing="0" class="table_khachhang">
  <tr>
    <td height="35" colspan="11" align="center" bgcolor="#FFFF99" class="title_table"><strong>Thông Tin Laptop</strong></td>
  </tr>
  <tr>
    <td width="32" align="center"><strong>STT</strong></td>
    <td width="85" align="center"><strong>Tên laptop</strong></td>
    <td width="69" align="center"><strong>Nhà sx</strong></td>
    <td width="76" align="center"><strong>Loại laptop</strong></td>
    <td width="72" align="center"><strong>Số lượng</strong></td>
    <td width="74" align="center"><strong>Đơn giá</strong></td>
    <td align="center"><strong>Hình</strong></td>
    <td width="81" align="center"><strong>Ngày nhập</strong></td>
    <td width="54" align="center"><strong>Nổi Bật</strong></td>
    <td width="38" align="center"><strong>Xóa</strong></td>
    <td width="41" align="center"><strong>Sửa</strong></td>
  </tr>
  <?php
  $stt = $x + 1;
  while($row = mysql_fetch_array($kq1))
  {
	  ?>
  <tr>
    <td align="center"><?php echo $stt; ?></td>
    <td class="khoangcach"><?php  echo $row[0]; ?></td>
    <td class="khoangcach"><?php  echo $row[1]; ?></td>
    <td class="khoangcach"><?php  echo $row[2]; ?></td>
    <td align="center"><?php  echo $row[3]; ?></td>
    <td class="khoangcach"><?php  echo $row[4]; ?></td>
    <td align="center" width="104"><img src="../laptop/<?php  echo $row[5]; ?>" width="100" height="75"></td>
    <td class="khoangcach"><?php  echo $row[6]; ?></td>
    <td align="center"><?php echo $row[8] ?></td>
    <td align="center"><a href="xoalaptop.php?idxoa=<?php echo $row[7]; ?>">Xóa</a></td>
     
    <td align="center"><a href="indexqt.php?idsua=<?php echo $row[7] ?>">Sửa</a></td>
  </tr>
  <?php
  $stt++;
  }
  ?>
</table>
<p align="center">
<?php
for($i = 1; $i <= $sotrang; $i++)
{
	if($p==$i)
	{
		echo "&nbsp;".$i."&nbsp;";
	}
	else
	{
		?>
    <a href="indexqt.php?act=thongtinlaptop&p=<?php  echo $i;   ?>"><?php  echo $i;  ?></a>
    
    
    <?php
	}		
}
?>
</p>
<p align="center">
<font color="#FF0000">Số laptop hiện tại là :</font> <?php  echo $sodulieu;     ?>
</p>
</body>
</html>